﻿<%@ Page Language="C#" MasterPageFile="../Share/Default.master" AutoEventWireup="true"
    CodeFile="Action.aspx.cs" Inherits="Menu_Action" Title="无标题页" %>
<%@ Register assembly="ClickOnceButton" Namespace="FreeHouse.Web.Controls" tagprefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">

    <script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
    <script src="../js/action.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" runat="Server">
    <table>
        <tr>
            <td>
                <asp:GridView ID="actionClass" SkinID="gvList" runat="server" AutoGenerateColumns="false" OnRowDataBound="actionClass_RowDataBound">
                    <Columns>
                        <asp:TemplateField>
                            <HeaderTemplate>
                                菜单对应Action
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table align="left">
                                    <tr>
                                        <th>
                                            <input class="actionClass" id="actionClass<%#Eval("ActionClassID") %>" type="checkbox"
                                                value="<%#Eval("ActionClassID") %>" />
                                            <label for="actionClass<%#Eval("ActionClassID") %>">
                                                <%#Eval("ClassName")%></label>
                                            说明:
                                            <%#Eval("Description") %>
                                        </th>
                                    </tr>
                                    <tr>
                                        <td>
                                            <asp:Localize ID="nodata" runat="server"></asp:Localize>
                                            <asp:Repeater ID="actions" runat="server">
                                                <ItemTemplate>
                                                    <input name="action" id="action<%#Eval("ActionID") %>" type="checkbox" value="<%#Eval("ActionID") %>"
                                                    <%#menuActions.Find(delegate(FreeHouse.Model.TMenuAction action) { return action.ActionId.ToString() == Eval("ActionID").ToString(); }) != null ? "checked=\"checked\"" : ""%>  />
                                                    <label for="action<%#Eval("ActionID") %>" title="<%#Eval("Description") %>">
                                                        <%#Eval("MethodName")%></label>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        暂无Action.
                    </EmptyDataTemplate>
                </asp:GridView>
            </td>
        </tr>
        <tr>
            <td>
                <cc1:clickoncebutton id="save" runat="server" text="保存" aftersubmittext="正在处理,请稍后..."
                    width="65px" onclick="save_Click" />
                &nbsp;<cc1:clickoncebutton id="back" runat="server" text="返回" aftersubmittext="正在处理,请稍后..."
                    width="65px" onclick="back_Click" />
            </td>
        </tr>
    </table>
</asp:Content>
